package com.spzx.product.api.service;

import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.domain.R;
import com.spzx.product.api.domain.vo.CategoryVo;
import com.spzx.product.api.factory.RemoteCategoryFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

@FeignClient(contextId = "RemoteCategoryService",value = "spzx-product",fallbackFactory = RemoteCategoryFallbackFactory.class)
public interface RemoteCategoryService {
    @GetMapping(value = "/category/getOneCategory/{parentId}")
    R<List<CategoryVo>> getOneCategory(@PathVariable(value = "parentId") Long parentId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/category/getCategoryTree")
    public R<List<CategoryVo>> getCategoryTree(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
